import sys
import os

# def doWaiting():
#     while 1:
#         print('start waiting:', time.strftime('%H:%M:%S'))
#         time.sleep(3)
#         print('stop waiting', time.strftime('%H:%M:%S'))

# t = threading.Thread(target=doWaiting)
# t.start()
# # 确保线程t已经启动
# # time.sleep(1)
# print('start job')
# print('end job')
#UI的类
module_ui = os.path.abspath('./server')
sys.path.append(module_ui)
import server as _server_


if __name__ == '__main__':
    print("test")
    _server_.server_init()


# if __name__ == '__main__':
#     # 1 创建 socket 对象
#     server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#     # 2 绑定 IP 和端口
#     # server_socket.bind(('电脑本机IP',8888))
#     server_socket.bind(('127.0.0.1',8888)) # 前面空，绑定服务器的任意一个网卡
 
#     # 3 监听，参数是同时连接的客户端数量
#     server_socket.listen(128)
#     print('等待ing.....')
#     # 4 阻塞等待客户端连接
#     # 返回一个元组  （新socket, (客户端IP,端口) ）
#     new_socket, client_ip_port = server_socket.accept()
 
#     # 5 新的socket收信息
#     buf = new_socket.recv(4096)
#     print(buf.decode())
#     # 6 新的socket发信息
#     send_data = (f'{client_ip_port}连接成功').encode()
#     new_socket.send(send_data)
#     # 7 关闭
#     new_socket.close()
#     server_socket.close()
